package com.lagou.zookeeper.zkclient;

import org.I0Itec.zkclient.ZkClient;

import java.util.List;

public class DeleteNote {
    public static void main(String[] args) {
         /*
            创建爱你一个zkClient实例就可以完成连接， 完成会话的创建
         */
        ZkClient zkClient = new ZkClient("127.0.0.1:2181");
        System.out.println("会话被创建了");

        //递归删除节点
        String path = "/base";
//        zkClient.createPersistent(path);
        zkClient.deleteRecursive(path);
        System.out.println("节点递归删除完成");
        List<String> children = zkClient.getChildren(path);
        System.out.println("删除后： " + children);
    }
}
